package com.tang.portal.component.harbor

import com.alibaba.fastjson2.JSON
import com.tang.portal.component.harbor.core.HarborBaseService
import org.apache.http.client.methods.HttpGet
import org.springframework.stereotype.Component
import org.springframework.stereotype.Service
import java.util.Arrays

/**
 * @author tang jun liang
 * @Date 2023/6/21 10:28
 */
@Component
class HarborArtifactService : HarborBaseService() {


    fun artifacts(projectName: String?, repositoryName: String?): MutableList<Map<*, *>>? {
        val httpGet = HttpGet("${getHarborConfigProperties().url}/Tag/v2.0/projects/$projectName/repositories/$repositoryName/artifacts")
        val result = execute(httpGet)
        return JSON.parseArray(result, Map::class.java);

    }
}
